#include<bits/stdc++.h>
#define ONLINE_JUDGE
#define ll long long
#define ull unsigned long long
using namespace std;

const int N = 2e5 + 10, INF = 0x3f3f3f3f;

int n, k;
set<int> s;
vector<int> g[N];
bool st[N];

int dfs(int x, int fa)
{
    int sum = 0, cnt = 0;
    for (int y : g[x]) {
        if (y == fa) continue;
        int t = dfs(y, x);
        if (t != 0) cnt++;
        sum += t;
    }
    int flag = s.count(x);
    if (flag == 0 && (sum > 0 && sum < k) || cnt >= 2)  st[x] = 1;
    if (flag == 1 && sum + 1 <= k) st[x] = 1;

    return sum + flag;
}

void solve()
{
    cin >> n >> k;
    for (int i = 1;i < n;i++) {
        int x, y;cin >> x >> y;
        g[x].push_back(y);
        g[y].push_back(x);
    }
    for (int i = 1;i <= k;i++) { int x; cin >> x; s.insert(x); }
    dfs(1, 0);
    int ans = 0;
    for (int i = 1;i <= n;i++) ans += st[i];
    cout << ans;
}

signed main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
    std::istringstream in(R"(7 2
1 2
1 3
2 4
2 5
3 6
3 7
3 5
)");
    std::cin.rdbuf(in.rdbuf());
#endif
    int T = 1;
    //cin>>T;
    for (int i = 1;i <= T;i++) {
        solve();
    }
}